package de.ba_rm.java.password.checker.logic.config;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 
 * @author sebastian.toense@gmail.com
 *
 */
@XmlRootElement
public class Rule {
	
	public static final String NAME_DEFAULT = "default";

	private String name;
	
	private int minLength;
	
	private int numLowerCase;
	
	private int numUpperCase;
	
	private int numCase;
	
	private int numSpecial;
	
	private int numNumbers;
	
	private int numSpecialBetweenChar;
	
	@XmlAttribute(required = true)
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	@XmlElement(required = true)
	public int getMinLength() {
		return minLength;
	}

	public void setMinLength(int minLength) {
		this.minLength = minLength;
	}

	@XmlElement(required = true)
	public int getNumLowerCase() {
		return numLowerCase;
	}

	public void setNumLowerCase(int numLowerCase) {
		this.numLowerCase = numLowerCase;
	}

	@XmlElement(required = true)
	public int getNumUpperCase() {
		return numUpperCase;
	}

	public void setNumUpperCase(int numUpperCase) {
		this.numUpperCase = numUpperCase;
	}

	@XmlElement(required = true)
	public int getNumCase() {
		return numCase;
	}

	public void setNumCase(int numCase) {
		this.numCase = numCase;
	}

	@XmlElement(required = true)
	public int getNumSpecial() {
		return numSpecial;
	}

	public void setNumSpecial(int numSpecial) {
		this.numSpecial = numSpecial;
	}

	@XmlElement(required = true)
	public int getNumNumbers() {
		return numNumbers;
	}

	public void setNumNumbers(int numNumbers) {
		this.numNumbers = numNumbers;
	}

	@XmlElement(required = true)
	public int getNumSpecialBetweenChar() {
		return numSpecialBetweenChar;
	}

	public void setNumSpecialBetweenChar(int numSpecialBetweenChar) {
		this.numSpecialBetweenChar = numSpecialBetweenChar;
	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

}
